/** 质检api */
import request from '@/utils/request'

// 根据id查询
export function qualityCheckProjectDetail(id) {
  return request({
    url: `/call-center/api/v1/qualityCheckProject/${id}`,
    method: 'GET'
  })
}
// 关闭
export function qualityCheckProjectClose(id) {
  return request({
    url: `/call-center/api/v1/qualityCheckProject/close/${id}`,
    method: 'PUT'
  })
}
// 生成项目
export function qualityCheckProjectAdd(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckProject/create-task`,
    method: 'POST',
    data
  })
}
// 发布
export function qualityCheckProjectRelease(id) {
  return request({
    url: `/call-center/api/v1/qualityCheckProject/release/${id}`,
    method: 'PUT'
  })
}
// 保存质检项目
export function qualityCheckProjectSave(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckProject/save`,
    method: 'POST',
    data
  })
}
// 保存执行人
export function qualityCheckProjectSaveExecutor(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckProject/save/executor`,
    method: 'PUT',
    data
  })
}
// 保存被执行人
export function qualityCheckProjectSaveLitigant(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckProject/save/litigant`,
    method: 'PUT',
    data
  })
}
// 保存关系
export function qualityCheckProjectSaveRelations(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckProject/save/relations`,
    method: 'PUT',
    data
  })
}
// 保存数据筛选条件
export function qualityCheckProjectSaveScreening(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckProject/save/screening-conditions`,
    method: 'PUT',
    data
  })
}

// 质检任务详情
export function qualityCheckTaskDetail(id) {
  return request({
    url: `/call-center/api/v1/qualityCheckTask/${id}`,
    method: 'GET'
  })
}
// 取消质检任务
export function qualityCheckTaskCancel(id) {
  return request({
    url: `/call-center/api/v1/qualityCheckTask/${id}`,
    method: 'PUT'
  })
}
// 申诉
export function qualityCheckTaskAppeal(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckTask/appeal`,
    method: 'PUT',
    data
  })
}
// 评分
export function qualityCheckTaskAppealGrade(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckTask/appealGrade`,
    method: 'POST',
    data
  })
}
// 申诉提交质检
export function qualityCheckTaskAppealQualityCheck(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckTask/appealQualityCheck`,
    method: 'PUT',
    data
  })
}

// 评分
export function qualityCheckTaskGrade(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckTask/grade`,
    method: 'POST',
    data
  })
}
// 提交质检
export function qualityCheck(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckTask/qualityCheck`,
    method: 'PUT',
    data
  })
}
// 批量更新质检任务质检人
export function qualityCheckReplace(data) {
  return request({
    url: `/call-center/api/v1/qualityCheckTask/replace`,
    method: 'PUT',
    data
  })
}

// 保存已质检过的源数据生成的质检任务
export function qualityCheckSave(identifyingCode) {
  return request({
    url: `/call-center/api/v1/qualityCheckTask/save/${identifyingCode}`,
    method: 'PUT'
  })
}
